//Written by Camel

function emailVali(){
    var name=document.getElementById('name');
    var email=document.getElementById('email');
    var msg=document.getElementById('message');
    if(name.value=='') {alert('Please fill in your name.'); return false;}
    else if(!isEmail(email.value)) {alert('Please fill in a valid email address.'); return false;}
    else if(msg.value=='') {alert('Please fill in your message.'); return false;}
    return true;
}

function isEmail(strEmail){
    if(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}